# -*- coding: utf-8 -*-


def main():
    with open("test_result_vgg_part_b_multi_10-10000.txt", "r") as result_file:
        raw_data = result_file.readlines()
    ground_truths = [float(e) for e in raw_data[0].strip().split(" ")]
    differences = [float(e) for e in raw_data[1].strip().split(" ")]
    sorted_differences = sorted(differences)
    print("total number: ", sum(ground_truths))
    print("total difference: ", sum(differences))
    print(sum(differences) / sum(ground_truths))
    print("max difference: ", sorted_differences[-1])
    sorted_index = sorted(range(len(differences)), key=lambda k: differences[k])
    print(sorted_index[-1])
    print(differences[sorted_index[-1]])
    print(ground_truths[sorted_index[-1]])
    ratio = [a / b for (a, b) in zip(differences, ground_truths)]
    ratio = sorted(ratio)
    print(ratio)


if __name__ == "__main__":
    main()
